<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/uv_udp_c.hpp 源文件</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">uv_udp_c.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d1/d41/uv__udp__c_8hpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#ifndef __UV_UDP_CLIENT_HPP__</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#define __UV_UDP_CLIENT_HPP__</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#include &lt;uv.h&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#include &quot;<a class="code" href="../../d0/d0e/misc_8hpp.html">misc.hpp</a>&quot;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span> </div>
<div class="foldopen" id="foldopen00016" data-start="{" data-end="};">
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html">   16</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d0/db2/class_c_u_v_u_d_p_client.html">CUVUDPClient</a></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span>{</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="keyword">public</span>:</div>
<div class="foldopen" id="foldopen00022" data-start="{" data-end="};">
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">   22</a></span>    <span class="keyword">enum</span> <a class="code hl_enumeration" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">err_code</a></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span>    {</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a954bfb15e76031d882a0c8224ac8fd3c">   24</a></span>        <a class="code hl_enumvalue" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a954bfb15e76031d882a0c8224ac8fd3c">ERR_UVCLIENT_INIT_MUTEX</a> = -1000,</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4adb1fe56770b6b0137c89c80d103445fd">   25</a></span>        <a class="code hl_enumvalue" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4adb1fe56770b6b0137c89c80d103445fd">ERR_UVCLIENT_LOOP_CONFIG</a> ,</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a59d32671aba83d6585a4d4f430cbd6c7">   26</a></span>        <a class="code hl_enumvalue" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a59d32671aba83d6585a4d4f430cbd6c7">ERR_UVCLIENT_LOOP_INIT</a>,</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4abeef9ec0f97e844e3d05996c698ef7ec">   27</a></span>        <a class="code hl_enumvalue" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4abeef9ec0f97e844e3d05996c698ef7ec">ERR_UVCLIENT_INIT_TCP</a>,</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4ad1c8ace856f5873c978a70fb53005a0a">   28</a></span>        <a class="code hl_enumvalue" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4ad1c8ace856f5873c978a70fb53005a0a">ERR_UVCLIENT_OPERATION</a>,</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a1015c8fb554edb866df2241034ddbc70">   29</a></span>        <a class="code hl_enumvalue" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a1015c8fb554edb866df2241034ddbc70">ERR_UVCLIENT_ALOCMEM</a>,</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4ae467ec1d6298a3fb26365595fce4341f">   30</a></span>        <a class="code hl_enumvalue" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4ae467ec1d6298a3fb26365595fce4341f">ERR_UVCLIENT_CONNECTION</a>,</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a43f5378127959b2f6d72ee5e2cc15ed6">   31</a></span>        <a class="code hl_enumvalue" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a43f5378127959b2f6d72ee5e2cc15ed6">ERR_RESOLVE_DNS</a>,</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span>        <a class="code hl_enumvalue" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a36a0f9020995bc3215b0e4445ddbaeb6">OK</a> = 0</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a36a0f9020995bc3215b0e4445ddbaeb6">   33</a></span>    };</div>
</div>
<div class="foldopen" id="foldopen00038" data-start="{" data-end="};">
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="../../d1/d13/struct_c_u_v_u_d_p_client_1_1st__wd.html">   38</a></span>    <span class="keyword">struct </span><a class="code hl_struct" href="../../d1/d13/struct_c_u_v_u_d_p_client_1_1st__wd.html">st_wd</a>{</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="../../d1/d13/struct_c_u_v_u_d_p_client_1_1st__wd.html#a22cd23807890533c95ad6d2e1c4e494a">   39</a></span>        uv_buf_t    <a class="code hl_variable" href="../../d1/d13/struct_c_u_v_u_d_p_client_1_1st__wd.html#a22cd23807890533c95ad6d2e1c4e494a">__buff</a>;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="../../d1/d13/struct_c_u_v_u_d_p_client_1_1st__wd.html#a9c1b1cdf0f2b607aa84abbbcefe2c7ab">   40</a></span>        <span class="keywordtype">void</span>     *  <a class="code hl_variable" href="../../d1/d13/struct_c_u_v_u_d_p_client_1_1st__wd.html#a9c1b1cdf0f2b607aa84abbbcefe2c7ab">__this</a>;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="../../d1/d13/struct_c_u_v_u_d_p_client_1_1st__wd.html#abeb8c689d97518e5fd2f1985bd394ca7">   41</a></span>        <span class="keywordtype">size_t</span>      <a class="code hl_variable" href="../../d1/d13/struct_c_u_v_u_d_p_client_1_1st__wd.html#abeb8c689d97518e5fd2f1985bd394ca7">__ds</a>;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>    };</div>
</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#afffd2bf3d059edbc434fc235e9c09887">   44</a></span>    <span class="keywordtype">bool</span>                  <a class="code hl_variable" href="../../d0/db2/class_c_u_v_u_d_p_client.html#afffd2bf3d059edbc434fc235e9c09887">m_dns_flag</a>;                <span class="comment">//dns解析是否完成</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a106e2c331ef06d7315342a3ff9f6ea6f">   45</a></span>    <span class="keywordtype">bool</span>                  <a class="code hl_variable" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a106e2c331ef06d7315342a3ff9f6ea6f">m_conn_flag</a>;               <span class="comment">//连接是否完成</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#ab197687f41a9f254d121e97e69da3b2e">   46</a></span>    uv_mutex_t            <a class="code hl_variable" href="../../d0/db2/class_c_u_v_u_d_p_client.html#ab197687f41a9f254d121e97e69da3b2e">m_mutex</a>;                   <span class="comment">//缓冲操作互斥对象</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a6937b113117e4ba9883d2772197ebfd3">   47</a></span>    uv_buf_t              <a class="code hl_variable" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a6937b113117e4ba9883d2772197ebfd3">m_o_buf</a>;                   <span class="comment">//输出缓冲</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a7d199945978b9157e64400139ebc80d0">   48</a></span>    uv_buf_t              <a class="code hl_variable" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a7d199945978b9157e64400139ebc80d0">m_i_buf</a>;                   <span class="comment">//输入缓冲</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span> </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span> </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#adcfc1d594a2c07b4974880be3fda7110">   51</a></span>    std::function&lt; void ( <span class="keywordtype">size_t</span> , <span class="keyword">const</span> <span class="keywordtype">char</span> * )&gt;   <a class="code hl_variable" href="../../d0/db2/class_c_u_v_u_d_p_client.html#adcfc1d594a2c07b4974880be3fda7110">cb_recv</a>;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a1741b75c5df3805d14c16a916bc15076">   52</a></span>    std::function&lt; void ( <span class="keywordtype">size_t</span> )&gt;                  <a class="code hl_variable" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a1741b75c5df3805d14c16a916bc15076">cb_send</a>;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5b1ce69d6083ef9dc876d7cd62eff460">   53</a></span>    std::function&lt; void () &gt;                         <a class="code hl_variable" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5b1ce69d6083ef9dc876d7cd62eff460">cb_close</a>;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#aae5214f882c7644a75481a1e3f67dee1">   54</a></span>    std::function&lt; void () &gt;                         <a class="code hl_variable" href="../../d0/db2/class_c_u_v_u_d_p_client.html#aae5214f882c7644a75481a1e3f67dee1">cb_conn</a>;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>    uv_thread_t          threadhanlde;                <span class="comment">//</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>    uv_udp_t             m_udp;                       <span class="comment">// libuv UDP 句柄</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>    <span class="keywordtype">int</span>                  m_port;                      <span class="comment">//服务器端口</span></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>    std::string          m_remote;                    <span class="comment">//远程地址，可以是url或者IP地址，支持IP6和IP4</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>    <span class="keyword">struct </span>sockaddr      m_addr;                      <span class="comment">// 通过域名获取的IP地址</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span> </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>    <a class="code hl_enumeration" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">err_code</a>             m_err;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>    std::string          err_msg;</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>        <span class="keywordtype">void</span> connecturl( );</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>    <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#ab9e61439fdd13324385227b5464407fa">CUVUDPClient</a>( <span class="keyword">const</span> std::string&amp; url , <span class="keywordtype">int</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a14695c91894f09e8bdb71d1771435441">port</a> );</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>    <span class="keyword">virtual</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a33a972b740da07acfd83c801fa1603b4">~CUVUDPClient</a>(  );</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a0ee1c096ae92172681081421731982ee">connect</a>();</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a0ee1c096ae92172681081421731982ee">connect</a>( <span class="keyword">const</span> std::string&amp; url , <span class="keywordtype">int</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a14695c91894f09e8bdb71d1771435441">port</a> );</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span> </div>
<div class="foldopen" id="foldopen00085" data-start="{" data-end="}">
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#ae8c4c54ca1365668b496f1ce80a4d5d7">   85</a></span>    <span class="keyword">operator</span> bool()</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>    {</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span>        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>    }</div>
</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span> </div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>    <a class="code hl_enumeration" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">err_code</a> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#abf1df16a268b9e83c2d5ce9fc1638a0e">Send</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* data , <span class="keywordtype">size_t</span> s );</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#af4ca766d83f425d979162d08b5700019">OnSend</a>( <span class="keywordtype">size_t</span> s , <a class="code hl_enumeration" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">err_code</a> e  );</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a42e8d07c237642c1bf725b6b0592826c">OnRecv</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* buff , <span class="keywordtype">size_t</span> s , <a class="code hl_enumeration" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">err_code</a> );</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span> </div>
<div class="foldopen" id="foldopen00115" data-start="{" data-end="}">
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a51190a5d46ea8ce9caff0d876546817c">  115</a></span>    uv_udp_t* <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a51190a5d46ea8ce9caff0d876546817c">Client</a>(  )</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span>    {</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>        <span class="keywordflow">return</span> &amp;m_udp;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>    }</div>
</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span> </div>
<div class="foldopen" id="foldopen00120" data-start="{" data-end="}">
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#ac5fb0db3d190ee591403be6478a382c2">  120</a></span>    <span class="keyword">const</span> std::string&amp; <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#ac5fb0db3d190ee591403be6478a382c2">GetURL</a>(  )<span class="keyword">const</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span><span class="keyword">    </span>{</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span>        <span class="keywordflow">return</span> m_remote;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span>    }</div>
</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span> </div>
<div class="foldopen" id="foldopen00125" data-start="{" data-end="}">
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a87028d1b70937d9aabbb0df5cc0a39ee">  125</a></span>    <span class="keywordtype">int</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a87028d1b70937d9aabbb0df5cc0a39ee">GetPort</a>(  )</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span>    {</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span>        <span class="keywordflow">return</span> m_port;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span>    }</div>
</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#ab5d10e0e945e1a91ff254871d01cc153">  129</a></span>    <span class="keyword">const</span> std::string&amp; <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#ab5d10e0e945e1a91ff254871d01cc153">server</a>( )<span class="keyword">const</span>{ <span class="keywordflow">return</span> m_remote; }</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a03c49814d30916d9bf96804e45ac2869">  130</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a03c49814d30916d9bf96804e45ac2869">server</a>( <span class="keyword">const</span> std::string&amp; svr ) { m_remote = svr; }</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a14695c91894f09e8bdb71d1771435441">  131</a></span>    <span class="keywordtype">int</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a14695c91894f09e8bdb71d1771435441">port</a>(){ <span class="keywordflow">return</span> m_port; }</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a0a2e3b951d3a5398d3c4ffc0a08e5aff">  132</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a0a2e3b951d3a5398d3c4ffc0a08e5aff">port</a>( <span class="keywordtype">int</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a14695c91894f09e8bdb71d1771435441">port</a> ){ m_port = <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a0a2e3b951d3a5398d3c4ffc0a08e5aff">port</a>; }</div>
<div class="foldopen" id="foldopen00133" data-start="{" data-end="}">
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a882539c888d5f77cb84cc1705e89e89e">  133</a></span>    <a class="code hl_enumeration" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">err_code</a> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a882539c888d5f77cb84cc1705e89e89e">Error</a>(  )</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span>    {</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span>        <span class="keywordflow">return</span> m_err;</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span>    }</div>
</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span> </div>
<div class="foldopen" id="foldopen00138" data-start="{" data-end="}">
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a8c1b9d349837e17b2511f7cd2f6c20b7">  138</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a8c1b9d349837e17b2511f7cd2f6c20b7">Error</a>( <span class="keywordtype">int</span> e )</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span>    {</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>        <span class="keywordflow">if</span>( !e ){</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>            m_err = <a class="code hl_enumvalue" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4ad1c8ace856f5873c978a70fb53005a0a">ERR_UVCLIENT_OPERATION</a>;</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>            err_msg = uv_strerror( e );</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>        }</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span>        <span class="keywordflow">else</span>{</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span>            m_err = <a class="code hl_enumvalue" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a36a0f9020995bc3215b0e4445ddbaeb6">OK</a>;</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno">  146</span>            err_msg.clear(  );</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno">  147</span>        }</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span>    }</div>
</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span> </div>
<div class="foldopen" id="foldopen00150" data-start="{" data-end="}">
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"><a class="line" href="../../d0/db2/class_c_u_v_u_d_p_client.html#ab412cce5bf561cf4710cbd87e771b5d3">  150</a></span>    std::string <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#ab412cce5bf561cf4710cbd87e771b5d3">ErrMsg</a>(  )</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span>    {</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span>        <span class="keywordflow">return</span> err_msg;</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>    }</div>
</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span> </div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span>    <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5428547933c12503b91ff2dc11fc46b2">need_dns</a>( <span class="keyword">const</span> std::string&amp; url );</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno">  156</span>};</div>
</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno">  157</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html">CUVUDPClient</a></div><div class="ttdoc">使用libuv实现的客户端连接.主要面向PC端的应用开发支持，也可以将这个库移植到android和 IOS系统上完成三种应用上统一的接口。</div><div class="ttdef"><b>定义</b> <a href="#l00016">uv_udp_c.hpp:17</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a03c49814d30916d9bf96804e45ac2869"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a03c49814d30916d9bf96804e45ac2869">CUVUDPClient::server</a></div><div class="ttdeci">void server(const std::string &amp;svr)</div><div class="ttdef"><b>定义</b> <a href="#l00130">uv_udp_c.hpp:130</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a0a2e3b951d3a5398d3c4ffc0a08e5aff"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a0a2e3b951d3a5398d3c4ffc0a08e5aff">CUVUDPClient::port</a></div><div class="ttdeci">void port(int port)</div><div class="ttdef"><b>定义</b> <a href="#l00132">uv_udp_c.hpp:132</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a0ee1c096ae92172681081421731982ee"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a0ee1c096ae92172681081421731982ee">CUVUDPClient::connect</a></div><div class="ttdeci">void connect()</div><div class="ttdoc">连接操作。</div><div class="ttdef"><b>定义</b> <a href="../../de/d89/uv__udp__c_8cpp_source.html#l00186">uv_udp_c.cpp:186</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a106e2c331ef06d7315342a3ff9f6ea6f"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a106e2c331ef06d7315342a3ff9f6ea6f">CUVUDPClient::m_conn_flag</a></div><div class="ttdeci">bool m_conn_flag</div><div class="ttdef"><b>定义</b> <a href="#l00045">uv_udp_c.hpp:45</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a14695c91894f09e8bdb71d1771435441"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a14695c91894f09e8bdb71d1771435441">CUVUDPClient::port</a></div><div class="ttdeci">int port()</div><div class="ttdef"><b>定义</b> <a href="#l00131">uv_udp_c.hpp:131</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a1741b75c5df3805d14c16a916bc15076"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a1741b75c5df3805d14c16a916bc15076">CUVUDPClient::cb_send</a></div><div class="ttdeci">std::function&lt; void(size_t)&gt; cb_send</div><div class="ttdef"><b>定义</b> <a href="#l00052">uv_udp_c.hpp:52</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a33a972b740da07acfd83c801fa1603b4"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a33a972b740da07acfd83c801fa1603b4">CUVUDPClient::~CUVUDPClient</a></div><div class="ttdeci">virtual ~CUVUDPClient()</div><div class="ttdef"><b>定义</b> <a href="../../de/d89/uv__udp__c_8cpp_source.html#l00119">uv_udp_c.cpp:119</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a42e8d07c237642c1bf725b6b0592826c"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a42e8d07c237642c1bf725b6b0592826c">CUVUDPClient::OnRecv</a></div><div class="ttdeci">void OnRecv(const char *buff, size_t s, err_code)</div><div class="ttdoc">接收到数据后，调用这个函数</div><div class="ttdef"><b>定义</b> <a href="../../de/d89/uv__udp__c_8cpp_source.html#l00227">uv_udp_c.cpp:227</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a51190a5d46ea8ce9caff0d876546817c"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a51190a5d46ea8ce9caff0d876546817c">CUVUDPClient::Client</a></div><div class="ttdeci">uv_udp_t * Client()</div><div class="ttdef"><b>定义</b> <a href="#l00115">uv_udp_c.hpp:115</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a5428547933c12503b91ff2dc11fc46b2"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5428547933c12503b91ff2dc11fc46b2">CUVUDPClient::need_dns</a></div><div class="ttdeci">bool need_dns(const std::string &amp;url)</div><div class="ttdef"><b>定义</b> <a href="../../de/d89/uv__udp__c_8cpp_source.html#l00080">uv_udp_c.cpp:80</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a5a6f2da7e8e321136e4d2a2e2ab4c7c4"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">CUVUDPClient::err_code</a></div><div class="ttdeci">err_code</div><div class="ttdef"><b>定义</b> <a href="#l00022">uv_udp_c.hpp:23</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a5a6f2da7e8e321136e4d2a2e2ab4c7c4a1015c8fb554edb866df2241034ddbc70"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a1015c8fb554edb866df2241034ddbc70">CUVUDPClient::ERR_UVCLIENT_ALOCMEM</a></div><div class="ttdeci">@ ERR_UVCLIENT_ALOCMEM</div><div class="ttdef"><b>定义</b> <a href="#l00029">uv_udp_c.hpp:29</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a5a6f2da7e8e321136e4d2a2e2ab4c7c4a36a0f9020995bc3215b0e4445ddbaeb6"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a36a0f9020995bc3215b0e4445ddbaeb6">CUVUDPClient::OK</a></div><div class="ttdeci">@ OK</div><div class="ttdef"><b>定义</b> <a href="#l00033">uv_udp_c.hpp:32</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a5a6f2da7e8e321136e4d2a2e2ab4c7c4a43f5378127959b2f6d72ee5e2cc15ed6"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a43f5378127959b2f6d72ee5e2cc15ed6">CUVUDPClient::ERR_RESOLVE_DNS</a></div><div class="ttdeci">@ ERR_RESOLVE_DNS</div><div class="ttdef"><b>定义</b> <a href="#l00031">uv_udp_c.hpp:31</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a5a6f2da7e8e321136e4d2a2e2ab4c7c4a59d32671aba83d6585a4d4f430cbd6c7"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a59d32671aba83d6585a4d4f430cbd6c7">CUVUDPClient::ERR_UVCLIENT_LOOP_INIT</a></div><div class="ttdeci">@ ERR_UVCLIENT_LOOP_INIT</div><div class="ttdef"><b>定义</b> <a href="#l00026">uv_udp_c.hpp:26</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a5a6f2da7e8e321136e4d2a2e2ab4c7c4a954bfb15e76031d882a0c8224ac8fd3c"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a954bfb15e76031d882a0c8224ac8fd3c">CUVUDPClient::ERR_UVCLIENT_INIT_MUTEX</a></div><div class="ttdeci">@ ERR_UVCLIENT_INIT_MUTEX</div><div class="ttdef"><b>定义</b> <a href="#l00024">uv_udp_c.hpp:24</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a5a6f2da7e8e321136e4d2a2e2ab4c7c4abeef9ec0f97e844e3d05996c698ef7ec"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4abeef9ec0f97e844e3d05996c698ef7ec">CUVUDPClient::ERR_UVCLIENT_INIT_TCP</a></div><div class="ttdeci">@ ERR_UVCLIENT_INIT_TCP</div><div class="ttdef"><b>定义</b> <a href="#l00027">uv_udp_c.hpp:27</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a5a6f2da7e8e321136e4d2a2e2ab4c7c4ad1c8ace856f5873c978a70fb53005a0a"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4ad1c8ace856f5873c978a70fb53005a0a">CUVUDPClient::ERR_UVCLIENT_OPERATION</a></div><div class="ttdeci">@ ERR_UVCLIENT_OPERATION</div><div class="ttdef"><b>定义</b> <a href="#l00028">uv_udp_c.hpp:28</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a5a6f2da7e8e321136e4d2a2e2ab4c7c4adb1fe56770b6b0137c89c80d103445fd"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4adb1fe56770b6b0137c89c80d103445fd">CUVUDPClient::ERR_UVCLIENT_LOOP_CONFIG</a></div><div class="ttdeci">@ ERR_UVCLIENT_LOOP_CONFIG</div><div class="ttdef"><b>定义</b> <a href="#l00025">uv_udp_c.hpp:25</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a5a6f2da7e8e321136e4d2a2e2ab4c7c4ae467ec1d6298a3fb26365595fce4341f"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5a6f2da7e8e321136e4d2a2e2ab4c7c4ae467ec1d6298a3fb26365595fce4341f">CUVUDPClient::ERR_UVCLIENT_CONNECTION</a></div><div class="ttdeci">@ ERR_UVCLIENT_CONNECTION</div><div class="ttdef"><b>定义</b> <a href="#l00030">uv_udp_c.hpp:30</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a5b1ce69d6083ef9dc876d7cd62eff460"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a5b1ce69d6083ef9dc876d7cd62eff460">CUVUDPClient::cb_close</a></div><div class="ttdeci">std::function&lt; void() &gt; cb_close</div><div class="ttdef"><b>定义</b> <a href="#l00053">uv_udp_c.hpp:53</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a6937b113117e4ba9883d2772197ebfd3"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a6937b113117e4ba9883d2772197ebfd3">CUVUDPClient::m_o_buf</a></div><div class="ttdeci">uv_buf_t m_o_buf</div><div class="ttdef"><b>定义</b> <a href="#l00047">uv_udp_c.hpp:47</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a7d199945978b9157e64400139ebc80d0"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a7d199945978b9157e64400139ebc80d0">CUVUDPClient::m_i_buf</a></div><div class="ttdeci">uv_buf_t m_i_buf</div><div class="ttdef"><b>定义</b> <a href="#l00048">uv_udp_c.hpp:48</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a87028d1b70937d9aabbb0df5cc0a39ee"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a87028d1b70937d9aabbb0df5cc0a39ee">CUVUDPClient::GetPort</a></div><div class="ttdeci">int GetPort()</div><div class="ttdef"><b>定义</b> <a href="#l00125">uv_udp_c.hpp:125</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a882539c888d5f77cb84cc1705e89e89e"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a882539c888d5f77cb84cc1705e89e89e">CUVUDPClient::Error</a></div><div class="ttdeci">err_code Error()</div><div class="ttdef"><b>定义</b> <a href="#l00133">uv_udp_c.hpp:133</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_a8c1b9d349837e17b2511f7cd2f6c20b7"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#a8c1b9d349837e17b2511f7cd2f6c20b7">CUVUDPClient::Error</a></div><div class="ttdeci">void Error(int e)</div><div class="ttdef"><b>定义</b> <a href="#l00138">uv_udp_c.hpp:138</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_aae5214f882c7644a75481a1e3f67dee1"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#aae5214f882c7644a75481a1e3f67dee1">CUVUDPClient::cb_conn</a></div><div class="ttdeci">std::function&lt; void() &gt; cb_conn</div><div class="ttdef"><b>定义</b> <a href="#l00054">uv_udp_c.hpp:54</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_ab197687f41a9f254d121e97e69da3b2e"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#ab197687f41a9f254d121e97e69da3b2e">CUVUDPClient::m_mutex</a></div><div class="ttdeci">uv_mutex_t m_mutex</div><div class="ttdef"><b>定义</b> <a href="#l00046">uv_udp_c.hpp:46</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_ab412cce5bf561cf4710cbd87e771b5d3"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#ab412cce5bf561cf4710cbd87e771b5d3">CUVUDPClient::ErrMsg</a></div><div class="ttdeci">std::string ErrMsg()</div><div class="ttdef"><b>定义</b> <a href="#l00150">uv_udp_c.hpp:150</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_ab5d10e0e945e1a91ff254871d01cc153"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#ab5d10e0e945e1a91ff254871d01cc153">CUVUDPClient::server</a></div><div class="ttdeci">const std::string &amp; server() const</div><div class="ttdef"><b>定义</b> <a href="#l00129">uv_udp_c.hpp:129</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_ab9e61439fdd13324385227b5464407fa"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#ab9e61439fdd13324385227b5464407fa">CUVUDPClient::CUVUDPClient</a></div><div class="ttdeci">CUVUDPClient(const std::string &amp;url, int port)</div><div class="ttdoc">构造客户端对象</div><div class="ttdef"><b>定义</b> <a href="../../de/d89/uv__udp__c_8cpp_source.html#l00092">uv_udp_c.cpp:92</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_abf1df16a268b9e83c2d5ce9fc1638a0e"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#abf1df16a268b9e83c2d5ce9fc1638a0e">CUVUDPClient::Send</a></div><div class="ttdeci">err_code Send(const char *data, size_t s)</div><div class="ttdoc">发送数据。这个函数发送的时候不会将要发送的数据拷贝到缓冲区中 因此需要在具体应用的时候进行数据内存管理。</div><div class="ttdef"><b>定义</b> <a href="../../de/d89/uv__udp__c_8cpp_source.html#l00143">uv_udp_c.cpp:143</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_ac5fb0db3d190ee591403be6478a382c2"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#ac5fb0db3d190ee591403be6478a382c2">CUVUDPClient::GetURL</a></div><div class="ttdeci">const std::string &amp; GetURL() const</div><div class="ttdef"><b>定义</b> <a href="#l00120">uv_udp_c.hpp:120</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_adcfc1d594a2c07b4974880be3fda7110"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#adcfc1d594a2c07b4974880be3fda7110">CUVUDPClient::cb_recv</a></div><div class="ttdeci">std::function&lt; void(size_t, const char *)&gt; cb_recv</div><div class="ttdef"><b>定义</b> <a href="#l00051">uv_udp_c.hpp:51</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_af4ca766d83f425d979162d08b5700019"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#af4ca766d83f425d979162d08b5700019">CUVUDPClient::OnSend</a></div><div class="ttdeci">virtual void OnSend(size_t s, err_code e)</div><div class="ttdoc">完成发送后会调用这个函数</div><div class="ttdef"><b>定义</b> <a href="../../de/d89/uv__udp__c_8cpp_source.html#l00135">uv_udp_c.cpp:135</a></div></div>
<div class="ttc" id="aclass_c_u_v_u_d_p_client_html_afffd2bf3d059edbc434fc235e9c09887"><div class="ttname"><a href="../../d0/db2/class_c_u_v_u_d_p_client.html#afffd2bf3d059edbc434fc235e9c09887">CUVUDPClient::m_dns_flag</a></div><div class="ttdeci">bool m_dns_flag</div><div class="ttdef"><b>定义</b> <a href="#l00044">uv_udp_c.hpp:44</a></div></div>
<div class="ttc" id="amisc_8hpp_html"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html">misc.hpp</a></div></div>
<div class="ttc" id="astruct_c_u_v_u_d_p_client_1_1st__wd_html"><div class="ttname"><a href="../../d1/d13/struct_c_u_v_u_d_p_client_1_1st__wd.html">CUVUDPClient::st_wd</a></div><div class="ttdef"><b>定义</b> <a href="#l00038">uv_udp_c.hpp:38</a></div></div>
<div class="ttc" id="astruct_c_u_v_u_d_p_client_1_1st__wd_html_a22cd23807890533c95ad6d2e1c4e494a"><div class="ttname"><a href="../../d1/d13/struct_c_u_v_u_d_p_client_1_1st__wd.html#a22cd23807890533c95ad6d2e1c4e494a">CUVUDPClient::st_wd::__buff</a></div><div class="ttdeci">uv_buf_t __buff</div><div class="ttdef"><b>定义</b> <a href="#l00039">uv_udp_c.hpp:39</a></div></div>
<div class="ttc" id="astruct_c_u_v_u_d_p_client_1_1st__wd_html_a9c1b1cdf0f2b607aa84abbbcefe2c7ab"><div class="ttname"><a href="../../d1/d13/struct_c_u_v_u_d_p_client_1_1st__wd.html#a9c1b1cdf0f2b607aa84abbbcefe2c7ab">CUVUDPClient::st_wd::__this</a></div><div class="ttdeci">void * __this</div><div class="ttdef"><b>定义</b> <a href="#l00040">uv_udp_c.hpp:40</a></div></div>
<div class="ttc" id="astruct_c_u_v_u_d_p_client_1_1st__wd_html_abeb8c689d97518e5fd2f1985bd394ca7"><div class="ttname"><a href="../../d1/d13/struct_c_u_v_u_d_p_client_1_1st__wd.html#abeb8c689d97518e5fd2f1985bd394ca7">CUVUDPClient::st_wd::__ds</a></div><div class="ttdeci">size_t __ds</div><div class="ttdef"><b>定义</b> <a href="#l00041">uv_udp_c.hpp:41</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
